<template>
  <div>
    <p>{{$store.getters.showNum}}</p>
    <button @click="btnAdd">+1</button>
    <button @click="btnAddN">+N</button>
    <button @click="btnAddAsync">异步+1</button>
    <button @click="btnAddNAsync">异步+N</button>
  </div>
</template>

<script>
  export default {
    data () {
      return {}
    },
    methods: {
      btnAdd () {
        this.$store.commit('add')
      },
      btnAddN () {
        this.$store.commit('addN', 3)
      },
      btnAddAsync () {
        this.$store.dispatch('addAsync')
      },
      btnAddNAsync () {
        this.$store.dispatch('addNAsync', 4)
      }
    }
  }
</script>
